import React, { useState } from 'react';
import {  } from "react-router-dom";
import { Input,Button } from "antd";
function Search({ccc}) {
    const [keyWord,setKeyWord]=useState('')
    const addd=()=>{
        ccc({keyWord})
    }
    const kong=()=>{
        ccc({keyWord:''})
        setKeyWord('')
    }
    return (
        <div>
            <Input style={{maxWidth:'200px'}} placeholder="请输入搜索内容" value={keyWord} onChange={(e)=>{setKeyWord(e.target.value)}} />
        <Button  type="primary" onClick={addd}>搜素</Button>
        <Button  type="primary" onClick={kong}>清空</Button>
        </div>
    );
}

export default Search;